import request from '@/utils/request'
// 获取所有的负责人
export function getEmployeesSimple() {
  return request({
    url: '/sys/user/simple',
    methods: 'get'

  })
}

export function getEmployees(params) {
  return request({
    url: '/sys/user',
    methods: 'get',
    params

  })
}
/**
 * @description: 添加员工
 * @param {*} data
 * @return {*}
 */
export function addEmployees(data) {
  return request({
    method: 'post',
    url: '/sys/user',
    data
  })
}
export function delEmployees(id) {
  return request({
    method: 'delete',
    url: `/sys/user/${id}`
  })
}

// 导入excel
export function importEmployees(data) {
  return request({
    method: 'post',
    url: `/sys/user/batch`,
    data

  })
}

// 保存员工的信息
export function saveUserDetailById(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put', // 全量修改
    data
  })
}

// 获取岗位信息
export function getJobDetail(id) {
  return request({
    url: `/employees/${id}/jobs`,
    method: 'get'
  })
}
